Use -Wl,--pic-veneer instead of -fno-optimize-sibling-calls in Makefile.vita
#17760
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When building RetroArch for PlayStation Vita, Makefile.vita currently passes
-fno-optimize-sibling-callsto the compiler to work around a bug where if sibling call optimization is enabled, the compiler may generate veneers to switch between ARM mode and Thumb mode. The veneers cause Vita SDK's tools to break -- the code will still compile, but the compiled binary crashes when executed when it tries to call a veneer.However, according to vitasdk/buildscripts#123, it's possible to stop the veneers from breaking things by passing
-Wl,--pic-veneerwhen linking.This seems like a better solution than
-fno-optimize-sibling-callsin my opinion because there may be other things that generate veneers than just sibling calls. In fact, I'm working on a new libretro core, and the compiler still generates veneers even when-fno-optimize-sibling-callsis enabled in both RetroArch and every single file in my core's code, so using-Wl,--pic-veneeris the only solution for me.